<html>
	<head>
	<title>登录</title>
	  <link rel="stylesheet" href="css\bootstrap.css">
	  <script src="js/jquery-1.11.3.js"></script>
	  <script src="js/bootstrap.js"></script>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8">
	</head>
	<body>
		<div style="height:70px"></div>
		<div class="row">
			<div class="col-xs-4"></div>
			<div class="panel panel-default control-panel col-xs-4">
				<div class="panel-heading">
					<span class="glyphicon glyphicon-glass">登陆点餐系统</span>
				</div>
				<div class="panel-body">
					<form class="form-horizontal" method="POST">
						<div class="form-group">
							<label for="input1" class="col-xs-3 control-label">帐号：</label>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="input1" placeholder="userName" name="userName">
							</div>
						</div>
						<div class="form-group">
							<label for="input2" class="col-xs-3 control-label">密码：</label>
							<div class="col-xs-9">
								<input type="password" class="form-control" id="input2" placeholder="passWord" name="passWord">
							</div>
						</div>
						<div class="row"><div class="col-xs-9"></div>
							<div class="btn-group">
							<button class="btn btn-primary">登录</button>
							</div>
						</div>
					</form>
				</div>	
			</div>
		</div>
	</body>
</html>
<?php
	@$userName=$_REQUEST['userName'];
	@$passWord=$_REQUEST['passWord'];
	$pdo=new PDO('mysql:dbname=test;charset=utf8','root'); 
	$sel=$pdo->prepare('select * from entry where username=:name');
	$isok=$sel->execute(array('name'=>$userName));
	$pwd=$sel->fetch(PDO::FETCH_NAMED);
	if($isok){
		if(empty($pwd)){ exit;}
		if($passWord == $pwd['password']){
			header('Location:dcxt.php');
			} else {
				echo "密码错误";
				}
	} else {echo "用户名错误";}
?>